package com.anzia.study_5.slice;

import com.anzia.study_5.ResourceTable;
import com.anzia.study_5.utils.UIUtils;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class MainAbilitySlice extends AbilitySlice {
	@Override
	public void onStart(Intent intent) {
		super.onStart(intent);
		super.setUIContent(ResourceTable.Layout_dependentlayout_demo);

		Text text = (Text) findComponentById(ResourceTable.Id_text_content);
		text.setClickedListener(component -> {
			// UIUtils.showTip(MainAbilitySlice.this, text.getText(), 5000);
			UIUtils.showConfirmTip(MainAbilitySlice.this, text.getText());
		});
	}

	@Override
	public void onActive() {
		super.onActive();
	}

	@Override
	public void onForeground(Intent intent) {
		super.onForeground(intent);
	}
}
